import { View } from "../../../mvc/core/View";
import { ObjCreate } from "../common/ObjCreate";
import { ImagesConst } from "../../resource/ImagesConst";
import { GTextFormat } from "../../../common/GTextFormat";
import { Language } from "../../../../extend/language/Language";
import { GTileList } from "../../../../com/mui/controls/GTileList";
import { ScrollBarDirection } from "../../../../fl/controls/ScrollBarDirection";
import { MarketSearchRenderer } from "./MarketSearchRenderer";
import { DataProvider } from "../../../../fl/data/DataProvider";
import { EMarketRecordType } from "../../../../Message/Game/EMarketRecordType";
type int = number;
//class SearchResultList
    
    export  class SearchResultList extends View
    {
        constructor()
        {
            super();
            this.init();
            return;
        }

        /* internal  */init(): void
        {
            var loc1=ObjCreate.createBg(0, 0, 522, 370, this);
            var loc2=ObjCreate.createBg(-1, -3, 527, 30, this, ImagesConst.RbListHeader);
            var loc3=new GTextFormat("", 14, 16571138);
            var loc4=ObjCreate.createTextField(Language.getString(31044), 30, 5, 80, 25, this, loc3);
            var loc5=ObjCreate.createTextField(Language.getString(31045), 140, 5, 40, 25, this, loc3);
            this._priceTitle = ObjCreate.createTextField(Language.getString(31046), 220, 5, 40, 25, this, loc3);
            this._sellerTitle = ObjCreate.createTextField(Language.getString(31047), 300, 5, 40, 25, this, loc3);
            var loc6=ObjCreate.createTextField(Language.getString(31048), 420, 5, 40, 25, this, loc3);
            this._titleList = new GTileList();
            this._titleList.setSize(522, 345);
            this._titleList.columnWidth = 510;
            this._titleList.rowHeight = 50;
            this._titleList.direction = ScrollBarDirection.VERTICAL;
            this._titleList.horizontalGap = 0;
            this._titleList.verticalGap = 0;
            this._titleList.width = width + 15;
            this._titleList.height = height;
            this._titleList.styleName = "TileList";
            this._titleList.setStyle("skin", new Object /* flash.display.Bitmap */());
            this._titleList.setStyle("cellRenderer", MarketSearchRenderer);
            this._titleList.move(0, 30);
            this._titleList.dataProvider = new DataProvider();
            addChild(this._titleList);
            return;
        }

        public updateTitle(arg1: int): void
        {
            var loc1=arg1;
            switch (loc1) 
            {
                case EMarketRecordType._EMarketRecordTypeSell:
                {
                    this._priceTitle.text = Language.getString(31046);
                    this._sellerTitle.text = Language.getString(31047);
                    break;
                }
                case EMarketRecordType._EMarketRecordTypeSeekBuy:
                {
                    this._priceTitle.text = Language.getString(31128);
                    this._sellerTitle.text = Language.getString(31129);
                    break;
                }
            }
            return;
        }

        public updateDataProvider(arg1: Array<any>): void
        {
            this._titleList.dataProvider = new DataProvider(arg1);
            return;
        }

        /* internal */ /* var */_titleList: GTileList;

        /* internal */ /* var */_sellerTitle: Object /* flash.text.TextField */;

        /* internal */ /* var */_priceTitle: Object /* flash.text.TextField */;
    }
